/** 视频摄像机管理 */
import { Get, Post, PostJson } from './request';

export interface ICamera {
    allNum?: number,
    areaId: number,
    createId?: number,
    createTime?: string,
    id: number,
    ipAddress: string,
    onlineNum?: number,
    status?: number,
    type?: number,
    updateTime?: string,
    editStatus?: string,
    url?: string,
}
/** 获取所有视频摄像机列表 */
export const getCameraAll = (): Promise<ICamera[]> => Get('/camera/all')

/** 删除摄像机
 * ids
 */
export const deleteCameraApi = (data: any) => PostJson('/camera/delete', data)

/** 区域内视频摄像机列表
 * areaId
 */
export const getCamerasByArea = (params: any): Promise<ICamera[]> => Post('/camera/getByArea', params)

/** 视频摄像机信息
 * id
 */
export const getCameraInfo = (id: number) => Get(`/camera/info/${id}`)

/** 摄像机分页列表
 * 
 */
export const getCameraList = (params: any) => Get(`/camera/list`, params)

/** 新增摄像机 */
export const addCameraApi = (data: any) => PostJson('/camera/save', data)

/** 更新摄像机 */
export const updateCameraApi = (data: any) => PostJson('/camera/update', data)

/** 批量修改摄像机 */
export const saveBatchCamerasApi = (data: any) => PostJson('/camera/saveBatch', data)
